package org.example.runningforum.Controller;


import org.example.runningforum.modle.ArticleTopic;
import org.example.runningforum.server.ArticleTopicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/articleTopic")
public class ArticleTopicController {

    @Autowired
    private ArticleTopicService articleTopicService;


    @RequestMapping("/getNameAndCount")
    public List<ArticleTopic> getNameAndCount(){
        return articleTopicService.selectCountAndName();
    }

}
